#include <iostream>

using namespace std;

int main()
{string s;
cout<<"Enter The Order"<<endl;
cin>>s;
string s1;
char a;
for (int i=0; i<s.length();i++)
{a=s[i];
    if ((a == '(')||(a == '{')||(a == '[')||(a == '<')||s1 =="")
        s1+=a;
    else
    {
        if(s1!="")
    {
        if(((a==')') && (s1[s1.length()-1]=='('))||((a=='}') && (s1[s1.length()-1]== '{'))||((a==']') && (s1[s1.length()-1]== '['))||((a=='>') && (s1[s1.length()-1]== '<')) )
            s1.pop_back();
    }
    }
}
if (s1=="")
    cout<<"True";
else cout<<"False";

return 0;}
